obj-y += ofd_fixup.o
obj-y += ofd_fixup_memory.o
obj-y += physdev.o
+obj-y += platform.o
obj-y += rtas.o
obj-y += setup.o
obj-y += shadow.o
#include <xen/perfc.h>
#include <asm/init.h>
#include <asm/page.h>
+#include <asm/platform.h>
#include <asm/string.h>
#include <public/arch-powerpc.h>
/* Its a grant table access */
t = PFN_TYPE_GNTTAB;
mfn = gnttab_shared_mfn(d, d->grant_table, (pfn - max_page));
- } else if (d->is_privileged && cpu_io_mfn(pfn)) {
+ } else if (d->is_privileged && platform_io_mfn(pfn)) {
t = PFN_TYPE_IO;
mfn = pfn;
} else {
return max_page + (mfn - gnttab_mfn);
/* IO? */
- if (d->is_privileged && cpu_io_mfn(mfn))
+ if (d->is_privileged && platform_io_mfn(mfn))
return mfn;
rma_mfn = page_to_mfn(d->arch.rma_page);
#include <asm/current.h>
#include <asm/papr.h>
#include <asm/hcalls.h>
+#include <asm/platform.h>
#ifdef DEBUG
#define DBG(fmt...) printk(fmt)
if (lpte.bits.v) {
ulong mfn = lpte.bits.rpn;
- if (!cpu_io_mfn(mfn)) {
+ if (!platform_io_mfn(mfn)) {
struct page_info *pg = mfn_to_page(mfn);
struct domain *f = page_get_owner(pg);
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper <ryanh@us.ibm.com>
+ * Hollis Blanchard <hollisb@us.ibm.com>
+ */
+
+#include <asm/page.h>
+#include <asm/platform.h>
+
+#define IO_RANGE_START (2UL << 30)
+#define IO_RANGE_END (4UL << 30)
+#define IO_SIZE (IO_RANGE_END - IO_RANGE_START)
+
+unsigned long platform_iohole_base(void)
+{
+ return IO_RANGE_START;
+}
+
+unsigned long platform_iohole_size(void)
+{
+ return IO_SIZE;
+}
+
+int platform_io_mfn(unsigned long mfn)
+{
+ unsigned long maddr = mfn << PAGE_SHIFT;
+ return maddr > IO_RANGE_START && maddr < IO_RANGE_END;
+}
return log_large_page_sizes[0] - PAGE_SHIFT;
}
-/* This is more a platform thing than a CPU thing, but we only have
- * one platform now */
-int cpu_io_mfn(ulong mfn)
-{
- /* totally cheating */
- if (mfn >= (2UL << (30 - PAGE_SHIFT)) && /* 2GiB */
- mfn < (4UL << (30 - PAGE_SHIFT))) /* 4GiB */
- return 1;
-
- return 0;
-}
-
int cpu_threads(int cpuid)
{
return 1;
extern uint cpu_large_page_orders(uint *sizes, uint max);
extern void cpu_initialize(int cpuid);
extern void cpu_init_vcpu(struct vcpu *);
-extern int cpu_io_mfn(ulong mfn);
extern int cpu_threads(int cpuid);
extern void save_cpu_sprs(struct vcpu *);
extern void load_cpu_sprs(struct vcpu *);
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper <ryanh@us.ibm.com>
+ */
+
+#ifndef _ASM_PLATFORM_H_
+#define _ASM_PLATFORM_H_
+
+extern unsigned long platform_iohole_base(void);
+extern unsigned long platform_iohole_size(void);
+extern int platform_io_mfn(unsigned long mfn);
+
+#endif